package com.example.utils;

import java.io.BufferedReader;
import java.io.FileReader;
import java.io.IOException;

public class ReaderTxt {
    public static String readFileByLines(String filePath){
        BufferedReader reader = null;
        String txt = "";
        try{
            reader = new BufferedReader(new FileReader(filePath));
            String tempString = null;
            int ling = 1;
            while((tempString = reader.readLine()) != null) {
                txt += tempString+"\n";
                ling++;
            }
            reader.close();
        } catch (IOException e){
            e.printStackTrace();
        } finally {
            if (reader != null){
                try{
                    reader.close();
                }catch (IOException e1){

                }
            }
        }
        return txt;
    }
}
